package cn.edu.sdjzu.xg.eagle.entity;

import lombok.NoArgsConstructor;
import lombok.ToString;

@NoArgsConstructor
@ToString
public class Teacher implements Comparable<Teacher> {
    private static final Department department = new Department(1, "计算机科学与技术");
    private Integer id;
    private String name;
    private Integer department_id;

    public Teacher(Long id, String name, Department department_id) {
        this(id, name, department_id, department);
        this.id = Math.toIntExact(id);
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setDepartment_id(Integer department_id) {
        this.department_id = department_id;
    }

    public Integer getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public Integer getDepartment_id() {
        return department_id;
    }

    public Teacher(Long id, String name, Department department_id, Department department) {
        super();
        this.name = name;
        this.department_id = department_id.getId();
    }

    @Override
    public int compareTo(Teacher o) {
        return this.name.compareTo(o.name);
    }
}
